/**
 * Created by web-01 on 2017/10/23.
 */

onmessage=function (e) {
 var val=e.data;
 var sum=0;
 for(var i=0;i<val;i++){
   sum+=i;
 }
  postMessage(sum);
}